package com.example.pre.service.impl;

import java.util.Collection;
import java.util.Map;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.example.pre.dao.BillingDataDao;
import com.example.pre.model.BillingData;
import com.example.pre.service.BillingDataService;

/*
 * 报销明细service层实现类
 */
@Service
public class BillingDataServiceImpl implements BillingDataService {

	@Autowired
	private BillingDataDao billingDataDao;

	@Override
	public BillingData get(int id) {
		return billingDataDao.get(id);
	}

	@Override
	public Collection<BillingData> getAll() {
		return billingDataDao.listByCondition(null);
	}

	@Override
	public boolean update(BillingData m) {
		return billingDataDao.update(m) == 1;
	}

	@Override
	public boolean delete(int id) {
		return billingDataDao.delete(id) == 1;
	}

	@Override
	public boolean create(BillingData m) {
		return billingDataDao.create(m) == 1;
	}

	@Override
	public Collection<BillingData> listByCondition(Map<String, Object> whereColumn) {
		return billingDataDao.listByCondition(whereColumn);
	}

	@Override
	public int countByCondition(Map<String, Object> whereColumn) {
		return billingDataDao.countByCondition(whereColumn);
	}

	@Override
	public int createBatch(Collection<BillingData> billingDatas) {
		return billingDataDao.createBatch(billingDatas);
	}

}
